package admin

import (
	"github.com/gin-gonic/gin"
	"likeadmin/core" 
	"likeadmin/middleware" 
	"likeadmin/admin/article_collect"
)

// 请在 admin/entry.go 目录引入这个函数
// ArticleCollectRoute(rg)
func ArticleCollectRoute(rg *gin.RouterGroup) {
	db := core.GetDB()

	server := article_collect.NewArticleCollectService(db)

	handle := article_collect.ArticleCollectHandler{Service: server}

	rg = rg.Group("/", middleware.TokenAuth())
	rg.GET("/article_collect/list", handle.List)
	rg.GET("/article_collect/detail", handle.Detail)
	rg.POST("/article_collect/add", handle.Add)
	rg.POST("/article_collect/edit", handle.Edit)
	rg.POST("/article_collect/del", handle.Del)
}